package org.aurora.framework.boot.data.common.dataobject;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.aurora.framework.boot.common.constants.DateFormatConstants;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * name: AuditDO
 * <p>
 * desc: Base data object containing audit information, It is abstract.
 * <p>
 * create date: 2024-09-25 16:54:41
 *
 * @author cao.yong
 */
public abstract class AuditDO<ID extends Serializable> implements BaseDO<ID> {
    /**
     * Create datetime
     */
    @JsonFormat(pattern = DateFormatConstants.DATE_TIME_PATTERN)
    private LocalDateTime createdDate;

    /**
     * Last modified datetime
     */
    @JsonFormat(pattern = DateFormatConstants.DATE_TIME_PATTERN)
    private LocalDateTime lastModifiedDate;
    /**
     * Tenant id
     */
    private Long tenantId;
    /**
     * Delete flag
     */
    private Integer deleted;
    /**
     * optimistic lock version
     */
    private Integer lockVersion;

    public LocalDateTime getCreatedDate() {
        return createdDate;
    }

    public void setCreatedDate(LocalDateTime createdDate) {
        this.createdDate = createdDate;
    }

    public LocalDateTime getLastModifiedDate() {
        return lastModifiedDate;
    }

    public void setLastModifiedDate(LocalDateTime lastModifiedDate) {
        this.lastModifiedDate = lastModifiedDate;
    }

    public Long getTenantId() {
        return tenantId;
    }

    public void setTenantId(Long tenantId) {
        this.tenantId = tenantId;
    }

    public Integer getDeleted() {
        return deleted;
    }

    public void setDeleted(Integer deleted) {
        this.deleted = deleted;
    }

    public Integer getLockVersion() {
        return lockVersion;
    }

    public void setLockVersion(Integer lockVersion) {
        this.lockVersion = lockVersion;
    }
}
